<?php
function smarty_function_paging($params, &$smarty)
{
	$isMultiParam  	= isset($params['params']) 	? $params['params']		: 0;
	$intOffset	  	= isset($params['offset']) 	? $params['offset']		: 0;
	$intTotal 	  	= isset($params['total']) 	? $params['total'] 		: 0;
	$intLimit 	  	= isset($params['limit']) 	? $params['limit'] 		: 0;	
	$strUrl 	  	= isset($params['url']) 	? $params['url']		: Ecore_Function::urlPaging($isMultiParam);	
	$intDisplay	  	= isset($params['display']) ? $params['display']	: 10;
	$strDiv	  		= isset($params['div']) 	? $params['div']		: '';
	$intJson	  	= isset($params['json']) 	? $params['json']		: 0;
	$strName	  	= isset($params['name']) 	? $params['name']		: 'page';
	$objPaging 		= new Ecore_Paging($intTotal, $intLimit, $intOffset, $strUrl, $strName);	
	if ($strDiv!='') {		
		if ($intJson == 0) {
			$strPaging 	= $objPaging->getAjax($intDisplay, $strDiv);
		} else {
			$strPaging 	= $objPaging->getAjaxJson($intDisplay, $strDiv);
		}
	} else {
		$strPaging 	= $objPaging->get($intDisplay);
	}
	return $strPaging;
}
?>